/*
Copyright (c) 2006 - 2008  Universitaet Osnabrueck, virtUOS
Authors: Markus Ketterl, Johannes Emden, Nils Schuhmacher, Andreas Rickling

This file is part of virtPresenter.

virtPresenter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

virtPresenter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with virtPresenter.  If not, see <http://www.gnu.org/licenses/>.
*/

package virtPresenter.commands
{
	import com.adobe.cairngorm.control.CairngormEvent;
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.commands.ICommand;
	import virtPresenter.model.virtPresenterLocator;
	import virtPresenter.event.AdvancedScrubberResizeEvent;
	
	/**
	 * Command invokes drawing the scrubber.
	 * */
	public class DrawAdvancedScrubber implements ICommand
	{	
		/**
		 * Handler for a AdvancedScrubberResizeEvent. As sonn as the size of the window changes
		 * the scrubber has to be redrawn.
		 * */
		public function execute(event:CairngormEvent):void
		{
			if (virtPresenterLocator.getInstance().xmlReceived && virtPresenterLocator.getInstance().scrubber!=null )
			{
				var width:Number = AdvancedScrubberResizeEvent( event ).width;
				virtPresenterLocator.getInstance().scrubber.draw(width);
				trace("DrawAdvancedScrubber. Scrubber.draw is invoked.");
			}
		}	
		
	}
}